package ${packageName}.${subPackageName};

<#list customClassList as customClass>
import ${customClass};
</#list>
<#if hasRequiredField>
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.Length;
</#if>
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

<#if hasLocalDateTime>
import java.time.LocalDateTime;
</#if>
<#if hasBigDecimal>
import java.math.BigDecimal;
</#if>

/**
 * 创建或修改${businessName}信息
 *
 * @author ${author}
 * @since ${date}
 */
@Data
@Schema(description = "创建或修改${businessName}信息")
public class ${className} {
<#if fieldConfigs??>
  <#list fieldConfigs as fieldConfig>
    <#if fieldConfig.showInForm>

    @Schema(description = "${fieldConfig.comment}")
    <#if fieldConfig.isRequired>
    <#if fieldConfig.fieldType = 'String'>
    @NotBlank(message = "${fieldConfig.comment}不能为空")
    <#else>
    @NotNull(message = "${fieldConfig.comment}不能为空")
    </#if>
    </#if>
    <#if fieldConfig.fieldType = 'String' && fieldConfig.columnSize??>
    @Length(max = ${fieldConfig.columnSize}, message = "${fieldConfig.comment}长度不能超过 {max} 个字符")
    </#if>
    private ${fieldConfig.fieldType} ${fieldConfig.fieldName};
    </#if>
  </#list>
</#if>
}
